#include <stdio.h>
#include <string.h>
int main()
{
	char ch[100] = { 0 };
	fgets(ch, sizeof(ch), stdin);
	int len = strlen(ch);
	ch[len - 1] = 0;
	int count = 0;
	int i = 0;
	while (ch[i])
	{
		if (ch[i] == ' ')
			count++;
		i++;
	}
	printf("%d", len - 1 - count);
	return 0;
}